/**
 * Created by liuqingling on 16/4/12.
 */
module.exports=function(req,res,next){

    req.qparams = {};
    req.param('state')&&(req.qparams['state']=Number(req.param('state')));
    req.param('name')&&(req.qparams['name']=req.param('name'));
    req.param('phone')&&(req.qparams['phone']=req.param('phone'));
    req.param('email')&&(req.qparams['email']=req.param('email'));
    req.param('dstart')&&(req.qparams['date']={})&&(req.qparams['date']['$gte']=new Date(req.param('dstart')));
    req.param('dend')&&(req.qparams['date']['$lt']=new Date(req.param('dend')));
    //console.log(req.qparams);
    next();
}
